﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HCSAnalyzer.Forms.FormsForImages;

namespace HCSAnalyzer.Classes.ImageAnalysis.FormsForImages
{
    public partial class FormForNavigator : Form
    {
        FormForImageDisplay Sender;

        public FormForNavigator(FormForImageDisplay Sender)
        {
            InitializeComponent();
            this.Sender = Sender;
            if (Sender.AssociatedImage.Depth == 0)
                this.numericUpDownZPos.Maximum = 0;
            else
                this.numericUpDownZPos.Maximum = Sender.AssociatedImage.Depth - 1;

            this.trackBarForZPos.Maximum = (int)this.numericUpDownZPos.Maximum;
        }

        private void trackBarForZPos_Scroll(object sender, EventArgs e)
        {
            numericUpDownZPos.Value = trackBarForZPos.Value;
        }

        private void numericUpDownZPos_ValueChanged(object sender, EventArgs e)
        {
           // if (numericUpDownZPos.Value < 0) numericUpDownZPos.Value = (decimal)0;
            trackBarForZPos.Value = (int)numericUpDownZPos.Value;
            Sender.DrawPic();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Visible = false;
        }


    }
}
